import {createRouter, createWebHistory} from "vue-router";

const routes = [
  {
    path: "/",
    redirect: '/userinfo'
  },
  {//平台管理
    path: "/platform",
    name: "platform",
    component: () => import("../views/platform/index.vue"),
    meta: { hideNavigationBar: false } //默认情况下不隐藏NavigationBar
  },
  {//用户基本信息
    path: "/userinfo",
    name: "userinfo",
    component: () => import("../views/userinfo/index.vue"),
    meta: { hideNavigationBar: false } //默认情况下不隐藏NavigationBar
  },
  {//角色
    path: "/role",
    name: "role",
    component: () => import("../views/role/index.vue"),
    meta: { hideNavigationBar: false } //默认情况下不隐藏NavigationBar
  },
  {//权限
    path: "/menu",
    name: "menu",
    component: () => import("../views/menu/index.vue"),
    meta: { hideNavigationBar: false } //默认情况下不隐藏NavigationBar
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

// router/index.js 页面

router.beforeResolve((to, from, next) => {
  // console.log(to,from);
  next()
})


export default router;
